<!DOCTYPE html>
<html>
<head>
    <title>Events</title>

    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.default.min.css" rel="stylesheet">

    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.web.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
    <script>
        
    </script>
    
    
</head>
<body>
    
        <a class="offline-button" href="../index.html">Back</a>
    
    <div id="example" class="k-content">

    <div class="demo-section">
        <dl>
            <dt><label for="palette-picker">ColorPicker (palette):</label></dt>
            <dd>
                <input type="color" id="palette-picker" value="#cc2222" data-role="colorpicker" data-palette="basic">
            </dd>

            <dt><label for="hsv-picker">ColorPicker (HSV):</label></dt>
            <dd>
                <input type="color" id="hsv-picker" value="#22cc22" data-role="colorpicker">
            </dd>

            <dt>ColorPalette:</dt>
            <dd>
                <div id="palette" data-role="colorpalette"></div>
            </dd>

            <dt>FlatColorPicker:</dt>
            <dd>
                <div id="flatcolorpicker" data-role="flatcolorpicker"></div>
            </dd>
        </dl>
    </div>

    <script>
        // initialize widgets
        kendo.init($("#example"));

        // log events
        $("#palette-picker, #hsv-picker").each(function(){
            var colorPicker = $(this).data("kendoColorPicker");

            colorPicker.bind({
                select: function(e) {
                    kendoConsole.log("Select in picker #" + this.element.attr("id") + " :: " + e.value);
                },
                change: function(e) {
                    kendoConsole.log("Change in picker #" + this.element.attr("id") + " :: " + e.value);
                },
                open: function() {
                    kendoConsole.log("Open in picker #" + this.element.attr("id"));
                },
                close: function() {
                    kendoConsole.log("Close in picker #" + this.element.attr("id"));
                }
            });
        });

        var colorPalette = $("#palette").data("kendoColorPalette");
        colorPalette.bind("change", function(e) {
            kendoConsole.log("Change in color palette :: " + e.value);
        });

        var flatColorPicker = $("#flatcolorpicker").data("kendoFlatColorPicker");
        flatColorPicker.bind("change", function(e) {
            kendoConsole.log("Change in flat color picker :: " + e.value);
        });
    </script>

    <div class="demo-section">
        <h3 class="title">Console log</h3>
        <div class="console"></div>
    </div>

    <style scoped>
        .demo-section {
            width: 500px;
        }

        .demo-section dl {
            display: inline-block;
        }

        .demo-section dl:after {
            content: " ";
            clear: both;
            font: 0/0;
        }

        .demo-section dt,
        .demo-section dd {
            float: left;
            margin: 0;
            padding: 0 0 1em;
        }

        .demo-section dt {
            width: 45%;
            padding-top: .3em;
            padding-right: 5%;
            clear: left;
            text-align: right;
        }

        .demo-section dd {
            width: 50%;
        }
    </style>
</div>

</body>
</html>
